﻿package com.massiveProCreation.utils{	// IMPORTS	import com.greensock.TweenMax;	import com.greensock.easing.*;		import flash.display.MovieClip;	import flash.display.Sprite;	import flash.text.TextField;		public class ImagePreloader extends Sprite	{		private var _loaded:int = 0;				public function ImagePreloader()		{			// constructor			super();			this.mouseEnabled = false;		}		public function updateText(max:int):void {			_loaded++;			title.text = "Loaded " + _loaded + " / " + max; // update text field		}		public function updateBar(loaded:Number, max:Number):void {			var percent:Number = (loaded * 100) / max;	// update progress bac			bar.width = 68 * (percent/100);		}		public function loadEnd():void {				// animate preloader when loading ends			TweenMax.to(bar, 1, {alpha:0, ease:Expo.easeOut });			TweenMax.to(track, 1, {alpha:0, ease:Expo.easeOut });			TweenMax.to(title, 1, {x:-title.width + 10, delay:1,  ease:Expo.easeOut });		}	}}